//
//  UIView+LYZExtension.m
//  01-百思不得姐
//
//  Created by 李昱铮 on 16/8/22.
//  Copyright © 2016年 LYZ. All rights reserved.
//

#import "UIView+LYZExtension.h"

@implementation UIView (LYZExtension)

-(void)setSize:(CGSize)size
{
    CGRect fram = self.frame;
    fram.size = size;
    self.frame = fram;
}

-(CGSize)size
{
    return self.frame.size;
}

-(void)setWidth:(CGFloat)width
{
    CGRect fram = self.frame;
    fram.size.width = width;
    self.frame = fram;
}

-(void)setHeight:(CGFloat)height
{
    CGRect fram = self.frame;
    fram.size.height = height;
    self.frame = fram;
}

-(void)setX:(CGFloat)x
{
    CGRect fram = self.frame;
    fram.origin.x = x;
    self.frame = fram;
}

-(void)setY:(CGFloat)y
{
    CGRect fram = self.frame;
    fram.origin.y = y;
    self.frame = fram;
}

- (void)setCenetrX:(CGFloat)cenetrX
{
    CGPoint center = self.center;
    center.x = cenetrX;
    self.center = center;
}

- (void)setCenetrY:(CGFloat)cenetrY
{
    CGPoint center = self.center;
    center.y = cenetrY;
    self.center = center;
}

- (CGFloat)cenetrY
{
    return self.center.y;
}

- (CGFloat)cenetrX
{
    return self.center.x;
}

-(CGFloat)width
{
    return self.frame.size.width;
}

-(CGFloat)height
{
    return self.frame.size.height;
}

-(CGFloat)x
{
    return self.frame.origin.x;
}

-(CGFloat)y
{
    return self.frame.origin.y;
}

@end
